package com.example.demo.mysqlDao;

import com.example.demo.entity.*;
import com.example.demo.service.SynRecordService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface MysDao {

    List<Alarmitems> selectTest(Map<String, Object> params);

    //定时任务
    Map<String,Object> selectCron(Map<String, Object> params);

    //修改定时任务的时间配置
    int updateCron(Map<String, Object> params);


    //以下是各个表的批量插入
    //表1
    int insertAlarmitems(@Param("list") List<Alarmitems> list);
    //表2
    int insertBasicinfo(List<Basicinfo> alarmitems);
    //表3
    int insertCheckcar(List<Checkcar> alarmitems);
    //表4
    int insertChecksize(List<Checksize> alarmitems);
    //表5
    int insertCheckwheelscar(@Param("list") List<Checkwheelscar> list);
    //表6
    int insertOverdemarcationrecord(List<Overdemarcationrecord> alarmitems);
    //表7
    int insertJczb(@Param("list")List<Jczb> list);


    //同步记录表
    int insertSynRecord(@Param("record") SynRecord record);

    //以下是全量导入清空操作
    //表1
    int deleteAlarmitems(Map<String, Object> params);
    //表2
    int deleteBasicinfo(Map<String, Object> params);
    //表3
    int deleteCheckcar(Map<String, Object> params);
    //表4
    int deleteChecksize(Map<String, Object> params);
    //表5
    int deleteCheckwheelscar(Map<String, Object> params);
    //表6
    int deleteOverdemarcationrecord(Map<String, Object> params);
    //表7
    int deleteJczb(Map<String, Object> params);


    //以下获取mysql各个对应的表的最大时间
    //表1
    String selectAlarmitemsMaxTime();
    //表2
    String selectBasicinfoMaxTime();
    //表3
    String selectCheckcarMaxTime();
    //表4
    String selectChecksizeMaxTime();
    //表5
    String selectCheckwheelscarMaxTime();
    //表6
    String selectOverdemarcationrecordMaxTime();
    //表7
    String selectJczbMaxTime();


    List<SynRecord> findAllSynRecord(@Param("synType") String synType);

    List<SynRecord> getSynStatistics(@Param("synType") String synType);
}
